package com.cy.pj.common.service;

import com.cy.pj.common.dao.GoodsDao;
import com.cy.pj.common.pojo.Goods;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class GoodsServiceImpl implements GoodsService{
    @Autowired
    private GoodsDao goodsDao;
    @Override
    public List<Goods> findGoods(){
        List<Goods> list = goodsDao.findGoods();
        return list;
    }

    @Override
        public Integer doDelete(Integer id) {
        return goodsDao.doDelete(id);

    }

    @Override
    public int doInsert(Goods goods) {
        return goodsDao.doInsert(goods);
    }

    @Override
    public Goods findById(Integer id) {
        Goods goods = goodsDao.findById(id);
        return goods;
    }

    @Override
    public int doUpdate(Goods goods) {
        return goodsDao.doUpdate(goods);
    }


}
